"use strict";

// Calculate the nth Fibonacci number
function fib(n) {
  if (n <= 2) return 1;
  var a = 1,
    b = 1;
  for (var i = 3; i <= n; i++) {
    var temp = b;
    b += a;
    a = temp;
  }
  return b;
}
function main() {
  var result = 0;
  var num = 0;

  // Call the fib function
  for (var i = 1; i <= 500; i++) {
    result = fib(i);
    num = i; // Just to keep the same variable name as in the original code
  }

  console.log("num = ".concat(num));

  // Record end time and print results
  console.log('Fibonacci');
  console.log("Fibonacci number is: ".concat(result));
}
main();